/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.hnilica.cisteniulic.dto;

import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.collections.comparators.NullComparator;

/**
 *
 * @author swosh
 */
public class TerminCisOriId implements Serializable {

    private static final long serialVersionUID = 3L;
    private String nazUlice;
    private String nazAkce;
    static Comparator<String> nullSafeComparator = new NullComparator(String.CASE_INSENSITIVE_ORDER);

    public TerminCisOriId() {
    }

    public TerminCisOriId(String nazUlice, String nazAkce) {
        this.nazUlice = nazUlice;
        this.nazAkce = nazAkce;
    }

    public String getNazUlice() {
        return nazUlice;
    }

    public void setNazUlice(String nazUlice) {
        this.nazUlice = nazUlice;
    }

    public String getNazAkce() {
        return nazAkce;
    }

    public void setNazAkce(String nazAkce) {
        this.nazAkce = nazAkce;
    }


    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null || (object.getClass() != this.getClass())) {
            return false;
        }
        TerminCisOri terminCisOri = (TerminCisOri) object;
        int result = nullSafeComparator.compare(this.getNazAkce(), terminCisOri.getNazAkce());
        if (result != 0) {
            return false;
        }
        result = nullSafeComparator.compare(this.getNazUlice(), terminCisOri.getNazUlice());
        if (result != 0) {
            return false;
        }
        return true;


    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + (null == nazAkce ? 0 : nazAkce.hashCode());
        hash = 31 * hash + (null == nazUlice ? 0 : nazUlice.hashCode());
        return hash;
    }


}

